package Demo;

import java.util.Scanner;

public class Musician {
    void play(int i){
        if(i==1){
            Erhu er = new Erhu();
            er.makeSound();
        } else if (i==2) {
            Piano pi = new Piano();
            pi.makeSound();
        } else if (i==3) {
            Violin vi = new Violin();
            vi.makeSound();
        }
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Musician musician = new Musician();
        System.out.println("1二胡2钢琴3小提琴");
        musician.play(sc.nextInt());

    }
}
class Instrument{
    void makeSound(){}
}
class Erhu extends Instrument{
    @Override
    void makeSound() {
        System.out.println("二泉映月");
    }
}
class Piano extends Instrument{
    @Override
    void makeSound() {
        System.out.println("梁祝");
    }
}
class Violin extends Instrument{
    @Override
    void makeSound() {
        System.out.println("送春肥");
    }
}
